package edu.gatech.cc.hwa.server;

import edu.gatech.cc.hwa.server.features.BrowserFeature;
import edu.gatech.cc.hwa.server.features.DayOfWeekFeature;
import edu.gatech.cc.hwa.server.features.IpAddressFeature;
import edu.gatech.cc.hwa.server.features.OperatingSystemFeature;
import edu.gatech.cc.hwa.server.features.TimeOfDayFeature;
import edu.gatech.cc.hwa.server.features.TimeToTypePasswordFeature;
import edu.gatech.cc.hwa.server.security.encryption.KeyConverter;
import edu.gatech.cc.hwa.server.security.exceptions.HwaSecurityException;

public class AuthenticationParameters {
	
	private final BrowserFeature browserFeature;
	private final DayOfWeekFeature dayOfWeekFeature;
	private final String hashedPassword;
	private final IpAddressFeature ipAddressFeature;
	private final String name;
	private final OperatingSystemFeature operatingSystemFeature;
	private final String password;
	private final TimeOfDayFeature timeOfDayFeature;
	private final TimeToTypePasswordFeature timeToTypePasswordFeature;
		
	public AuthenticationParameters(String name
			, String password
			, BrowserFeature browser
			, OperatingSystemFeature os
			, TimeToTypePasswordFeature passwordTiming
			, IpAddressFeature ipAddress) throws HwaSecurityException {
		this.name = name;
		this.password = password;
		this.hashedPassword = new String(KeyConverter.createFullLengthPasswordHash(password));
		this.browserFeature = browser;
		this.dayOfWeekFeature = new DayOfWeekFeature();
		this.ipAddressFeature = ipAddress;
		this.operatingSystemFeature = os;
		this.timeToTypePasswordFeature = passwordTiming;
		this.timeOfDayFeature = new TimeOfDayFeature();
	}
	
	public BrowserFeature getBrowserFeature() {
		return browserFeature;
	}

	public DayOfWeekFeature getDayOfWeekFeature() {
		return dayOfWeekFeature;
	}

	public String getHashedPassword() {
		return hashedPassword;
	}

	public IpAddressFeature getIpAddressFeature() {
		return ipAddressFeature;
	}

	public String getName() {
		return name;
	}

	public OperatingSystemFeature getOperatingSystemFeature() {
		return operatingSystemFeature;
	}

	public String getPassword() {
		return password;
	}

	public TimeOfDayFeature getTimeOfDayFeature() {
		return timeOfDayFeature;
	}
	
	public TimeToTypePasswordFeature getTimeToTypePasswordFeature() {
		return timeToTypePasswordFeature;
	}
	
	public String getUserName() {
		return name;
	}
}
